package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AdvertisementAddressMapper;
import com.ruoyi.system.domain.AdvertisementAddress;
import com.ruoyi.system.service.IAdvertisementAddressService;

/**
 * 广告地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-02
 */
@Service
public class AdvertisementAddressServiceImpl implements IAdvertisementAddressService 
{
    @Autowired
    private AdvertisementAddressMapper advertisementAddressMapper;

    /**
     * 查询广告地址
     * 
     * @param addressId 广告地址主键
     * @return 广告地址
     */
    @Override
    public AdvertisementAddress selectAdvertisementAddressByAddressId(String addressId)
    {
        return advertisementAddressMapper.selectAdvertisementAddressByAddressId(addressId);
    }

    /**
     * 查询广告地址列表
     * 
     * @param advertisementAddress 广告地址
     * @return 广告地址
     */
    @Override
    public List<AdvertisementAddress> selectAdvertisementAddressList(AdvertisementAddress advertisementAddress)
    {
        return advertisementAddressMapper.selectAdvertisementAddressList(advertisementAddress);
    }

    /**
     * 新增广告地址
     * 
     * @param advertisementAddress 广告地址
     * @return 结果
     */
    @Override
    public int insertAdvertisementAddress(AdvertisementAddress advertisementAddress)
    {
        advertisementAddress.setCreateTime(DateUtils.getNowDate());
        return advertisementAddressMapper.insertAdvertisementAddress(advertisementAddress);
    }

    /**
     * 修改广告地址
     * 
     * @param advertisementAddress 广告地址
     * @return 结果
     */
    @Override
    public int updateAdvertisementAddress(AdvertisementAddress advertisementAddress)
    {
        advertisementAddress.setUpdateTime(DateUtils.getNowDate());
        return advertisementAddressMapper.updateAdvertisementAddress(advertisementAddress);
    }

    /**
     * 批量删除广告地址
     * 
     * @param addressIds 需要删除的广告地址主键
     * @return 结果
     */
    @Override
    public int deleteAdvertisementAddressByAddressIds(String[] addressIds)
    {
        return advertisementAddressMapper.deleteAdvertisementAddressByAddressIds(addressIds);
    }

    /**
     * 删除广告地址信息
     * 
     * @param addressId 广告地址主键
     * @return 结果
     */
    @Override
    public int deleteAdvertisementAddressByAddressId(String addressId)
    {
        return advertisementAddressMapper.deleteAdvertisementAddressByAddressId(addressId);
    }
}
